package com.abbcc.models;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.abbcc.service.BaseService;
import com.abbcc.service.ProductService;
import com.abbcc.util.BeansFactory;

@Entity
@Table(name = "p_recycle")
public class TdRecycle {
	private int recycleId;
	private String name;
	private Date delTime;
	private int belongId;
	@Id 
	@Column(name="recycle_id") 
	public int getRecycleId() {
		return recycleId;
	}
	public void setRecycleId(int recycleId) {
		this.recycleId = recycleId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name="del_time")
	public Date getDelTime() {
		return delTime;
	}
	public void setDelTime(Date delTime) {
		this.delTime = delTime;
	}
	@Column(name="belong_id")
	public int getBelongId() {
		return belongId;
	}
	public void setBelongId(int belongId) {
		this.belongId = belongId;
	}
	public String proName(){
		BaseService baseService = (BaseService)BeansFactory.get("baseService");
		TdProduct tp = (TdProduct) baseService.findById(TdProduct.class, this.getBelongId());
		return tp.getName();
	}
}
